/**
 * Created by Administrator on 2018/4/28.
 */
define(function (require,exports,module) {
    var sTpl = require("./template.html");
    require("./serviceBill.css");
    require("../../../lib/fullcalendar/moment.min.js");
    var VueComponent = Vue.extend({
        template: sTpl
        ,methods:{

            query :function(){
                var $this = this;
               axios.get(basepath+"/api/flightPlane/mySchedule").then(function (response) {
                   $this.tableData=[];
                   response.data.forEach(function (data) {
                       var map = {};
                       map.serviceTime =moment(new Date(data[0])).format("YYYY-MM-DD HH:mm")
                       map.flightPlane = data[1];
                       map.user = data[2]
                       map.groundServiceScheduling = data[3];
                       $this.tableData.push(map);
                   })


               });
            },pickStartDate:function(val){
                this.form.startDate= val;
            },pickEndDate:function(val){
                this.form.endDate= val;
            }
        },
        mounted:function() {
           this.query();
        }
        ,data:function(){
            var date = moment().format("YYYY-MM-DD");
            return {
                form:{
                    startDate:date+'00:00:00',
                    endDate:date+'23:59:59',
                },
                tableData:[]
            }
        },
        activated:function (){

            messages.$emit('change','我的任务');
        }
    });
    module.exports = VueComponent;
})
